package com.cn.demo.spark;

import java.util.*;

/**
 * 描述
 *
 * @author wangjf
 * @version 1.0
 * @createDate 2019/10/31 16:24
 * @projectName test
 */
public class HelloWorld {

    public static void main(String[] args) {


        Map<String,Integer> map = new HashMap<>();
        String test="Apache Spark achieves high performance for both batch and streaming data, using a state-of-the-art DAG scheduler, a query optimizer, and a physical execution engine.";

        String[] s = test.split(" ");
        for(int i=0;i<s.length;i++){

            if(map.get(s[i])==null){

                map.put(s[i],1);
            }else{
                map.put(s[i],map.get(s[i])+1);
            }

        }

        map.forEach((k,v)->{

            System.out.println("k="+k+"  v="+v);
        });



    }
}
